<template>
  <div class="page-header">
    <div class="header-content">
      <div class="title-section">
        <h1 class="page-title">{{ title }}</h1>
        <p v-if="subtitle" class="page-subtitle">{{ subtitle }}</p>
      </div>
      <div class="action-section" v-if="$slots.actions">
        <slot name="actions"></slot>
      </div>
    </div>
    <div class="divider"></div>
  </div>
</template>

<script>
export default {
  name: 'PageHeader',
  props: {
    title: {
      type: String,
      required: true
    },
    subtitle: {
      type: String,
      default: ''
    }
  }
};
</script>

<style scoped>
.page-header {
  margin-bottom: 24px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
}

.title-section {
  flex: 1;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  color: #303133;
  margin: 0;
  padding: 0;
}

.page-subtitle {
  font-size: 14px;
  color: #909399;
  margin: 8px 0 0 0;
  padding: 0;
}

.divider {
  height: 1px;
  background-color: #ebeef5;
  margin-bottom: 8px;
}

.action-section {
  display: flex;
  gap: 12px;
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .action-section {
    margin-top: 16px;
    width: 100%;
  }
}
</style> 